package br.uece.tcc.fh.jxta.controller;

import br.uece.tcc.fh.jxta.FhJxtaBase;
import br.uece.tcc.fh.jxta.FhMessenger;


public class FhJxtaController {

	private static FhJxtaController fhJxtaInstance = null;

	private FhJxtaBase fhBaseJxta;
	private FhMessenger fhMessenger;
	
	
	private FhJxtaController() {
		fhBaseJxta = new FhJxtaBase();
        //baseJxta.addObserver(screen);
        
		fhMessenger = new FhMessenger();
        Thread t = new Thread(fhMessenger);
        t.start();
	}

	public static FhJxtaController getInstance() {
		if (fhJxtaInstance == null) {
			fhJxtaInstance = new FhJxtaController();
		}
		return fhJxtaInstance;
	}
	
	public void iniciar(){
		fhBaseJxta.jxtaStart();
	}
	
	public FhJxtaBase getFhBaseJxta(){
		return fhBaseJxta;		
	}

}
